package com.baor.controller;

import com.baor.domain.CustomerVO;
import com.baor.domain.EquipmentHolder;
import com.baor.domain.EquipmentVO;
import com.baor.service.Equipment_holderService;
import com.baor.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "equipment_holder")
public class Equipment_holderController {
    @Autowired
    private Equipment_holderService equipment_holderService;
//  设备持有者列表
    @RequestMapping(value = "equipment_holderList")
    public R equipment_holderList(@RequestBody Map<String, Object> params){
        R r = this.equipment_holderService.equipment_holderList(params);
        return r;
    }

    // del
    @RequestMapping(value = "equipment_holderDel")
    public R equipment_holderDel(@RequestBody Map<String, Object> params){
        return this.equipment_holderService.equipment_holderDel(params);

    }

// 编辑
    @RequestMapping(value = "updateHolderInfo")
    public R updateHolderInfo(@RequestBody Map<String, Object> params){
        return this.equipment_holderService.updateHolderInfo(params);

    }
    //余额变更
    @RequestMapping(value = "updateBanlance")
    public R updateBanlance(@RequestBody Map<String, Object> params){
        return this.equipment_holderService.updateBanlance(params);

    }
    //设备持有者 新增设备
    @RequestMapping(value = "addEquipmentHolder")
    public R addEquipmentHolder(@RequestBody Map<String, Object> params){
        return this.equipment_holderService.addEquipmentHolder(params);

    }
    @RequestMapping(value = "addEquipment")
    private R addEquipment(@RequestBody Map<String, Object> params){
        return this.equipment_holderService.addEquipment(params);
    }

    //历史账单
    @RequestMapping(value = "historicalBills")
    public R historicalBills(@RequestBody Map<String, Object> params){
        return this.equipment_holderService.historicalBills(params);

    }

    @RequestMapping(value = "/deviceList")
    public R deviceList(@RequestBody Map<String,Object> params){
        return this.equipment_holderService.deviceList(params);
    }
    @RequestMapping(value = "/deviceUpdate")
    public R deviceUpdate(@RequestBody EquipmentHolder equipmentHolder){
        return this.equipment_holderService.updateDevice(equipmentHolder);
    }
    @RequestMapping(value = "/changeHolder")
    public R changeHolder(@RequestBody EquipmentHolder equipmentHolder){
        return this.equipment_holderService.changeHolder(equipmentHolder);
    }
}
